/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.managedbean.frontend;

import com.rbh.risk.entity.Profile;
import com.rbh.risk.model.TopReportModel;
import com.rbh.risk.service.AuthenticationService;
import com.rbh.risk.service.ReportService;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;

/**
 *
 * @author M
 */
@ManagedBean(name = "navigatorBean")
@ApplicationScoped
public class NavigatorBean implements Serializable {

    private static final long serialVersionUID = 1L;
    /*
     * Objects
     */
    @ManagedProperty(value = "#{topReportList}")
    private List<TopReportModel> topReportList;
    @ManagedProperty(value = "#{profile}")
    private Profile profile;
    /*
     * Service
     */
    @ManagedProperty(value = "#{reportService}")
    private ReportService reportSevice;
    @ManagedProperty(value = "#{authenticationService}")
    private AuthenticationService authenticationService;
    /*
     * Injection Field
     */

    public NavigatorBean() {
    }

    /*
     * Method For AutoComplete
     */
    public String navigator(String path) {
        return path;
    }

    public List<TopReportModel> getTopReportList() {
        return this.reportSevice.getTopReport(20);
    }

    public void setTopReportList(List<TopReportModel> topReportList) {
        this.topReportList = topReportList;
    }

    public ReportService getReportSevice() {
        return reportSevice;
    }

    public void setReportSevice(ReportService reportSevice) {
        this.reportSevice = reportSevice;
    }

    public Profile getProfile() {
        return this.authenticationService.getPrincipal().getProfile();
    }

    public void setProfile(Profile profile) {
        this.profile = profile;
    }

    public AuthenticationService getAuthenticationService() {
        return authenticationService;
    }

    public void setAuthenticationService(AuthenticationService authenticationService) {
        this.authenticationService = authenticationService;
    }
}